package com.lening.provider.controller.InternalWorkOrder;

import com.lening.common.base.BaseController;
import com.lening.provider.dto.InternalWorkOrder.WorkOrderTypeDTO;
import com.lening.provider.po.InternalWorkOrder.WorkOrderTypePO;
import com.lening.provider.service.InternalWorkOrder.WorkOrderTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 刘政华
 * @datetime 2024/6/5 11:38
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("workOrderTypes")
public class WorkOrderTypeController extends BaseController<WorkOrderTypePO, WorkOrderTypeDTO, WorkOrderTypeService> {

    @Resource
    private WorkOrderTypeService workOrderTypeService;

    @GetMapping("dropdown")
    public List<WorkOrderTypeDTO> getNewList(@RequestParam(name = "workOrderTypeName", required = false) String workOrderTypeName){
        List<WorkOrderTypeDTO> list = workOrderTypeService.getByName(workOrderTypeName);
        return list;
    }
    //work_order_type_name
}
